home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / tchrt3.zip / TCHRTV3.DOC < prev    next >
Text File  |  1990-07-23  |  76KB  |  2,175 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.                                      TCHRT
  22.  
  23.  
  24.  
  25.                      Turbo C High Resolution Timer Toolbox 
  26.  
  27.  
  28.  
  29.                                   Version 3.00
  30.  
  31.  
  32.  
  33.                           Shareware Evaluation Version
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.                                   Ryle Design
  49.  
  50.                                   P.O. Box 22
  51.  
  52.                           Mt. Pleasant, Michigan 48804
  53.  
  54.                                 (517) 773-0587
  55.  
  56.                                Cserv 73047,1765
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.                                  Contents
  76.  
  77.  
  78.  
  79.           TCHRT User Guide                                           1
  80.              Introduction  . . . . . . . . . . . . . . . . . . . . . 1
  81.              Functional Overview . . . . . . . . . . . . . . . . . . 2
  82.              Theory  . . . . . . . . . . . . . . . . . . . . . . . . 3
  83.              TCHRT Function Descriptions . . . . . . . . . . . . . . 4
  84.              Examples  . . . . . . . . . . . . . . . . . . . . . . . 8
  85.              Technical Support . . . . . . . . . . . . . . . . . . . 8
  86.              Shareware . . . . . . . . . . . . . . . . . . . . . . . 8
  87.  
  88.           TCHRT Function Reference                                  11
  89.              t_ask_delay . . . . . . . . . . . . . . . . . . . . .  11
  90.              t_ask_timer . . . . . . . . . . . . . . . . . . . . .  11
  91.              t_bios_ask  . . . . . . . . . . . . . . . . . . . . .  12
  92.              t_bios_entry  . . . . . . . . . . . . . . . . . . . .  12
  93.              t_bios_exit . . . . . . . . . . . . . . . . . . . . .  13
  94.              t_bios_fname  . . . . . . . . . . . . . . . . . . . .  13
  95.              t_bios_load_desc  . . . . . . . . . . . . . . . . . .  13
  96.              t_bios_report . . . . . . . . . . . . . . . . . . . .  14
  97.              t_bios_resume . . . . . . . . . . . . . . . . . . . .  14
  98.              t_bios_reset  . . . . . . . . . . . . . . . . . . . .  14
  99.              t_bios_rname  . . . . . . . . . . . . . . . . . . . .  15
  100.              t_bios_set_file . . . . . . . . . . . . . . . . . . .  15
  101.              t_bios_set_user . . . . . . . . . . . . . . . . . . .  15
  102.              t_bios_start  . . . . . . . . . . . . . . . . . . . .  16
  103.              t_bios_stop . . . . . . . . . . . . . . . . . . . . .  17
  104.              t_bios_suspend  . . . . . . . . . . . . . . . . . . .  18
  105.              t_calc_delay_ff . . . . . . . . . . . . . . . . . . .  18
  106.              t_calib . . . . . . . . . . . . . . . . . . . . . . .  18
  107.              t_cvt_time  . . . . . . . . . . . . . . . . . . . . .  19
  108.              t_delay_calib . . . . . . . . . . . . . . . . . . . .  19
  109.              t_diff  . . . . . . . . . . . . . . . . . . . . . . .  19
  110.              t_do_delay  . . . . . . . . . . . . . . . . . . . . .  20
  111.              t_do_delay_wints  . . . . . . . . . . . . . . . . . .  20
  112.              t_entry . . . . . . . . . . . . . . . . . . . . . . .  21
  113.              t_exit  . . . . . . . . . . . . . . . . . . . . . . .  21
  114.              t_fname . . . . . . . . . . . . . . . . . . . . . . .  21
  115.              t_get . . . . . . . . . . . . . . . . . . . . . . . .  22
  116.              t_get_delay_ff  . . . . . . . . . . . . . . . . . . .  22
  117.              t_hires_entry . . . . . . . . . . . . . . . . . . . .  23
  118.              t_hires_exit  . . . . . . . . . . . . . . . . . . . .  23
  119.              t_hook_int  . . . . . . . . . . . . . . . . . . . . .  23
  120.              t_min_delay . . . . . . . . . . . . . . . . . . . . .  24
  121.              t_name  . . . . . . . . . . . . . . . . . . . . . . .  24
  122.              t_report  . . . . . . . . . . . . . . . . . . . . . .  24
  123.              t_request . . . . . . . . . . . . . . . . . . . . . .  25
  124.              t_res_delay . . . . . . . . . . . . . . . . . . . . .  25
  125.              t_reset . . . . . . . . . . . . . . . . . . . . . . .  25
  126.  
  127.  
  128.  
  129.                                        i
  130.  
  131.  
  132.  
  133.  
  134.  
  135.              t_resume  . . . . . . . . . . . . . . . . . . . . . .  26
  136.              t_rname . . . . . . . . . . . . . . . . . . . . . . .  26
  137.              t_set_delay_ff  . . . . . . . . . . . . . . . . . . .  26
  138.              t_setmode . . . . . . . . . . . . . . . . . . . . . .  27
  139.              t_start . . . . . . . . . . . . . . . . . . . . . . .  27
  140.              t_stop  . . . . . . . . . . . . . . . . . . . . . . .  28
  141.              t_suspend . . . . . . . . . . . . . . . . . . . . . .  28
  142.              t_unhook_int  . . . . . . . . . . . . . . . . . . . .  28
  143.  
  144.           TCHRT V3.00 Registration . . . . . . . . . . . . . . . .  30
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                        ii
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.                                 TCHRT User Guide
  208.  
  209.  
  210.      Introduction
  211.  
  212.  
  213.      TCHRT  (Turbo  C  High  Resolution  Timer) is a software library  that
  214.      provides the software developer with  reliable  timing  functions that
  215.      work across  the entire Intel 80xxx PC compatible hardware environment
  216.      with microsecond resolution. The TCHRT timing logic  calibrates itself
  217.      to the host PC clock rate and processor environment at run-time,  so a
  218.      single executable program will yield  accurate  results  regardless of
  219.      the host microprocessor and clock speed.
  220.  
  221.      TCHRT  is  the  definitive choice for any PC application that requires
  222.      precision timing.  Some typical TCHRT applications are:
  223.  
  224.      Source Code Timer/Profiler
  225.      By  adding timer calls to source code  under  development,  TCHRT  can
  226.      generate a detailed summary  of  execution  time by program subroutine
  227.      and immediately  illustrate  the  software's  "hot  spots"  that might
  228.      benefit from further code or algorithm optimization.  Unlike "binning"
  229.      profilers  that display the number of "hits" in  a  range  of  program
  230.      addresses, TCHRT provides  a  direct one to one correspondence between
  231.      source code and elapsed time with user defined granularity.
  232.  
  233.      Hardware Performance Evaluator
  234.      The high resolution and  self  calibration  features  of TCHRT make it
  235.      ideal  for  insertion  in code to evaluate hardware performance.  Disk
  236.      drives,  numeric processors and CRT controllers  can  all  have  their
  237.      throughput measured very  accurately  with  TCHRT,  and  with numerous
  238.      timers  at  the  users   disposal,   many   device  functions  may  be
  239.      independently  measured  in  a single run.  The formatted timer report
  240.      generated  by  TCHRT  makes  compilation  and  interpretation  of test
  241.      results painless.
  242.  
  243.      Process Control
  244.      With TCHRT, process control applications that require  precise timings
  245.      or  precision  delays  are  easy  to  implement.    No longer will the
  246.      application developer have to make an educated guess as to how  long a
  247.      critical interrupt is taking to service an I/O port as TCHRT  can time
  248.      virtually any hardware or software interrupt and provide the developer
  249.      with  precise  accurate  timings  of  the  critical  procedure.    The
  250.      precision delay  functions  allow  the  programmer  to  implement data
  251.      acquisition loops with microsecond resolution.
  252.  
  253.      Timing and Scoring
  254.      TCHRT  is the perfect "timer engine" to build  a  timing  and  scoring
  255.      system for use in nearly any competitive event.  With  its microsecond
  256.      resolution and self calibration features, TCHRT surpasses conventional
  257.      sports   timing  equipment  resolution  and  allows  the   application
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.      developer to  package  high  resolution  timing  and  complete scoring
  268.      functionality in a single package.
  269.  
  270.      Library Source Code Included
  271.      Since the source code  to  the  TCHRT  linkable libraries is included,
  272.      users needing  a particular timing function not implemented can modify
  273.      the TCHRT functions to suit their particular requirements.
  274.  
  275.  
  276.      Functional Overview
  277.  
  278.  
  279.      The  functionality  of  TCHRT  can  be divided into  several  distinct
  280.      categories of timer services:
  281.  
  282.      TCHRT Timer Logic
  283.      These functions initialize  the  TCHRT  timing  system,  calibrate the
  284.      timing logic, provide a low level interface to the PC timing hardware,
  285.      and perform miscellaneous timing functions that  are  generally hidden
  286.      from  the  user.  Some of these functions will be of interest to users
  287.      who  need to design their own timer functions and want to build on the
  288.      TCHRT low level timer logic.
  289.  
  290.      Generic Timer Functions
  291.      These  functions allow the user to  control  arbitrary  event  timers.
  292.      Functions exist to start, stop,  suspend,  resume,  name,  get elapsed
  293.      time  and activation counts, and to  generate  detailed  reports  that
  294.      summarize  all  timer  activity.  Timer  reports may be output to  the
  295.      display, a disk  file,  or  to  the printer. A setmode function allows
  296.      users to run timers  with  interrupts enabled or disabled.  The number
  297.      of timers active concurrently is restricted  only by available memory.
  298.  
  299.      BIOS Interrupt Timer Functions
  300.      These  functions  are  similar  to  the Generic Timer  Functions,  but
  301.      operate only on BIOS  interrupts.   Using these functions the user may
  302.      install  timer   logic  in  any  PC  interrupt  vector,  and  complete
  303.      information on  that interrupt's activity can be generated.  Interrupt
  304.      timer  reports  list  interrupt  activity  broken  down  by  interrupt
  305.      function (contents of the AH register when the  interrupt  is invoked)
  306.      and text  files  containing  interrupt  function  descriptions  may be
  307.      loaded to describe each  interrupt  function  timer  in the BIOS timer
  308.      report.    Interrupt  description  files  are  provided  for important
  309.      software interrupts in the PC/MSDOS environment.   Multiple interrupts
  310.      may be timed concurrently.
  311.  
  312.      Precision Delay Functions
  313.      These functions allow the user  to  generate  delays  with microsecond
  314.      accuracy. Functions exist to  generate  delays,  query the delay logic
  315.      for available  delay resolution and minimum delay time possible (these
  316.      are hardware dependent), and to  "fine tune" the delay calibration for
  317.      one or more specific delay lengths.
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                     TCHRT  2
  328.  
  329.  
  330.  
  331.  
  332.  
  333.      Theory
  334.  
  335.  
  336.      TCHRT works by directly  interfacing  with channel 0 of the 8253 timer
  337.      chip found in all compatible PCs.  Channel 0 counts  from  65535 to 0,
  338.      when  it  triggers  BIOS  interrupt  8 and begins counting from  65535
  339.      again.  Interrupt 8 is the hardware timer interrupt, and it increments
  340.      the DOS time  of  day  data  word  in  the  BIOS data area, checks for
  341.      diskette motor activity  and  shuts  down  the  motor  if  needed, and
  342.      finally calls BIOS interrupt 1C (hex), which is known as  the software
  343.      timer tick.  At boot time, 1C contains an  IRET  instruction,  meaning
  344.      there is no routine installed in  that  vector.   Since the 8253 has a
  345.      period of 838 nanoseconds, the hardware timer tick occurs every 54.925
  346.      milliseconds, or 18.2 times a second, which is  the  standard software
  347.      time resolution of the PC.   The  8253  count can be read by accessing
  348.      the appropriate IO port, and by reading the 8253 count along  with the
  349.      low word DOS time of day count, we  can  construct  a  high resolution
  350.      time stamp, which  is  the  base  unit  of  time  for TCHRT.  The only
  351.      modifications we make to the PC  environment  is to change the mode of
  352.      channel 0 to give the output count a 50 percent duty cycle, which does
  353.      not  impact  any  other  PC  operations.    Thus  we  have  a  simple,
  354.      unobtrusive,  highly  accurate  time  reference  with  838  nanosecond
  355.      resolution.    Once  a highly accurate time reference is available, we
  356.      can use it to calibrate a  simple  function that contains an inner and
  357.      outer loop to generate precision delays.
  358.  
  359.      The accuracy of TCHRT is as  accurate  as  the 8253 timer chip and the
  360.      ability of the software to measure the overhead in retrieving the 8253
  361.      and DOS time of day data.  With the advent of  advanced  chips  in the
  362.      80286 and 80386 class, the  effects  of  instruction  prefetch queues,
  363.      pipelining, and  cache memory become significant and the same sequence
  364.      of  instructions  may  take  different  amounts  of  time  to  execute
  365.      depending   on   the   interaction   of  the  processor's  performance
  366.      optimization  mechanisms.    The  end  result  is  twofold:    TCHRT's
  367.      calibration  routines may experience inaccuracies, and software  under
  368.      test  may  give  different timing results on different runs.  Normally
  369.      the "jitter" introduced by these conditions  is  on the order of a few
  370.      microseconds.
  371.  
  372.      A  major  source  of  apparent  erratic timer behavior comes from  the
  373.      interaction of asynchronous software and hardware interrupts  that may
  374.      occur  during a timed interval.  While  the  PC/MSDOS  environment  is
  375.      essentially single-threaded,  there  is  enough  "background" activity
  376.      occurring  in the form of timer and  keyboard  interrupts  that  these
  377.      interrupts  may occur during an timed interval,  and  the  time  these
  378.      interrupts  take  to  complete  are  naturally  counted  in the  timed
  379.      interval.   For very short duration timing a  TCHRT  timer  mode  with
  380.      interrupts disabled is available,  but  that  may  not be suitable for
  381.      longer  duration  timings,  or  when  concurrent  timer   activity  is
  382.      required.  Be aware that few results in  the  PC  environment  will be
  383.      exactly  repeatable,  and  that some variance in the timing results is
  384.      unavoidable.
  385.  
  386.      The high resolution  delay  function of TCHRT is particularly affected
  387.      by  background  interrupts  and  processor   performance  optimization
  388.      mechanisms.    The  initial delay calibration will yield delays with a
  389.      variance of from one to three percent of the requested delay interval.
  390.  
  391.  
  392.  
  393.                                     TCHRT  3
  394.  
  395.  
  396.  
  397.  
  398.  
  399.      Additional functions are available to optimize  the  delay calibration
  400.      to a specific delay interval, and using these functions can reduce the
  401.      delay  error  to  between  zero  and  one  percent,  and thus they are
  402.      recommended for critical applications.
  403.  
  404.  
  405.      TCHRT Function Descriptions
  406.  
  407.  
  408.      The following is  a  brief  synopsis  of the functions found in TCHRT.
  409.      This chapter is meant to give  the  user  a brief overview, and is not
  410.      meant to be a definitive reference.  It  is  essential  that  the user
  411.      review the  complete  function  reference  in  the  Function Reference
  412.      chapter before using any TCHRT function.  Some functions may  not work
  413.      as they would appear at first inspection, and in order to achieve high
  414.      performance, TCHRT has a minimum of internal error checking to prevent
  415.      such catastrophes as NULL pointer references.
  416.  
  417.      TCHRT Timer Logic
  418.  
  419.      Initialization functions
  420.  
  421.      t_request           Requests the number of timers needed.
  422.      t_start             Initializes the TCHRT timer logic.
  423.      t_stop              Shuts down TCHRT and frees allocated memory.
  424.  
  425.      Internal functions
  426.  
  427.      t_get               Gets TCHRT time stamp with interrupts
  428.                          enabled.
  429.      t_hires_entry       Gets TCHRT time stamp with interrupts
  430.                          disabled.  8253 count is reset.
  431.      t_hires_exit        Gets TCHRT time stamp and restores interrupts
  432.      t_diff              Calculates elapsed time difference between
  433.                          two TCHRT time stamps.
  434.      t_calib             Calibrates TCHRT timer logic, resets all
  435.                          timers, and calls the delay calibration
  436.                          function.
  437.      t_bios_entry        Receives timer start request from interrupt
  438.                          service routine.
  439.      t_bios_exit         Receives timer stop request from interrupt
  440.                          service routine.
  441.      t_bios_load_desc    Loads interrupt function description file
  442.      t_hook_int          Installs timer calls in specified interrupt
  443.                          vector.
  444.      t_unhook_int        Removes timer calls from specified interrupt
  445.                          vector.
  446.      t_delay_calib       Calibrates delay logic.
  447.  
  448.      t_request is called by the user to specify the number of timers needed
  449.      for generic timer  operations  if  the  user  wishes  to  override the
  450.      default  number  of  timers provided (10).    Since  each  timer  data
  451.      structure is  allocated dynamically, the number of timers available is
  452.      restricted by the amount of heap available and the constraints  of the
  453.      memory model you are using. If  t_request  is used in your program, it
  454.      must be called before t_start.
  455.  
  456.  
  457.  
  458.  
  459.                                     TCHRT  4
  460.  
  461.  
  462.  
  463.  
  464.  
  465.      t_start allocates the appropriate  amount  of  heap  for the number of
  466.      timers requested, initializes those  timers,  and  calibrates  the low
  467.      level timer routines.   t_start  must always be invoked prior to using
  468.      any other timer functions with the exception of t_request.
  469.  
  470.      t_stop deallocates all allocated heap  associated  with  generic timer
  471.      activity and shuts down the timer logic.  t_stop must be  called prior
  472.      to program termination, and  no  further calls to TCHRT should be made
  473.      unless t_start is invoked first.
  474.  
  475.      The TCHRT internal functions of primary interest to the programmer are
  476.      t_get, which is the interface to  the  8253 timer chip;  t_diff, which
  477.      calculates  the  elapsed  time  between  two  TCHRT  time stamps;  and
  478.      t_calib, which calibrates the  timer  and delay logic to the host run-
  479.      time environment.
  480.  
  481.      Generic TCHRT Timer Functions
  482.  
  483.      This class of functions implement general purpose timer functionality.
  484.  
  485.      t_entry             Starts the specified timer.
  486.      t_exit              Stops the specified timer.
  487.      t_suspend           Suspends the specified timer.
  488.      t_resume            Resumes the specified suspended timer.
  489.      t_setmode           Specifies timer mode - interrupts on or off.
  490.      t_ask_timer         Gets accumulated activations and elapsed time
  491.                          for the specified timer
  492.      t_cvt_time          Converts microseconds to MM:SS.xxxxxx string.
  493.      t_reset             Resets one or all timers.
  494.      t_report            Generates timer report
  495.      t_name              Associates string with specified timer for
  496.                          display in timer report.
  497.      t_rname             Specifies title of timer report.
  498.      t_fname             Specifies destination file for timer report.
  499.      t_set_report        Specifies type of timer report generated.
  500.  
  501.      t_entry  and  t_exit  provide  the  mechanism  to  start  and  stop  a
  502.      microsecond timer.  Timers are specified by number from 0 to n-1 in C,
  503.      and  1  to  n in Pascal.  The number of  timers  available  is  10  by
  504.      default, but the user can use  t_request  to request as many timers as
  505.      available heap allows.  Multiple timers may be active at the same time
  506.      if interrupts are enabled.
  507.  
  508.      t_suspend and t_resume suspend and resume a timer previously activated
  509.      by t_entry.  Timer activation count is not  incremented  when t_resume
  510.      is called, which is useful if you are using timer activation counts to
  511.      track subroutine  activations in a profiling application, and for some
  512.      reason you wish to pause  the timer during the subroutine's activation
  513.      (perhaps before a call to another routine) and then restart it.
  514.  
  515.      t_setmode  allows  the  user to specify whether  timers  operate  with
  516.      interrupts enabled or disabled.   With  interrupts  enabled, intervals
  517.      greater than 54925 microseconds may  be timed, and multiple timers may
  518.      be active concurrently.  With  interrupts  disabled,  the  timer logic
  519.      will "roll over" after 54925 usecs,  and  only one timer may be active
  520.      at any time.  Timing short duration events with interrupts disabled is
  521.  
  522.  
  523.  
  524.  
  525.                                     TCHRT  5
  526.  
  527.  
  528.  
  529.  
  530.  
  531.      useful  if  background   system  interrupts  are  causing  significant
  532.      variations in timer results.
  533.  
  534.      t_ask_timer will return to  the  user  the  activation count and total
  535.      elapsed time in microseconds for the specified timer.  t_cvt_time will
  536.      convert  a microsecond time count into a  printable  string  with  the
  537.      format MM:SS.xxxxxx.  Timer activation counts and  accumulated elapsed
  538.      time can be reset to zero by using t_reset.
  539.  
  540.      t_report generates a complete  listing  of  all  timer activity.  This
  541.      listing can be directed to the display, a  disk  file,  or  a printer.
  542.      t_rname allows the user to give the timer report a  descriptive title.
  543.      t_fname overrides the default disk file name for  timer  reports going
  544.      to disk.  t_name allows the  user  to assign a descriptive text string
  545.      to  a  timer number - this string will be printed next  to  the  timer
  546.      number in the timer report.    Finally,  t_set_report  determines what
  547.      timers are listed on  the  timer report: either only those timers that
  548.      had  been activated, or all timers,  regardless  of  their  activation
  549.      count, up to the highest timer number activated.
  550.  
  551.      BIOS Interrupt Timer Functions
  552.  
  553.      This  class  of  functions   implement   the   BIOS   interrupt  timer
  554.      functionality.
  555.  
  556.      t_bios_start        Installs timers in specified interrupt
  557.                          vectors.
  558.      t_bios_stop         Removes all timers from interrupt vectors.
  559.      t_bios_suspend      Suspends specified interrupt timing.
  560.      t_bios_resume       Resumes interrupt timing in the specified
  561.                          vectors.
  562.      t_bios_set_user     Assigns timer to user specified interrupt.
  563.      t_bios_set_file     Assigns interrupt function description file
  564.                          name to the user specified interrupt timer.
  565.      t_bios_ask          Returns activations and elapsed for the
  566.                          specified interrupt function
  567.      t_bios_reset        Resets one or all function timers of the
  568.                          specified interrupt vector.
  569.      t_bios_report       Generates BIOS interrupt timer report.
  570.      t_bios_rname        Specifies title of BIOS timer report.
  571.      t_bios_fname        Specifies destination file for BIOS timer
  572.                          report.
  573.  
  574.      t_bios_start  initializes  BIOS interrupt timing  for  the  interrupts
  575.      specified.    Heap  is  allocated  for the required  data  structures,
  576.      interrupt function description files  are  loaded  if available, and a
  577.      new interrupt service  routine  for  each  interrupt  to  be  timed is
  578.      inserted in  the  interrupt  vector  table.    t_bios_stop essentially
  579.      reverses  this  process,  freeing  allocated  heap  and  restoring the
  580.      previous interrupt service vectors.    The  BIOS timer data structures
  581.      are separate from the generic timer structures, and thus t_request has
  582.      no effect on BIOS interrupt timer activity.
  583.  
  584.      t_bios_suspend and  t_bios_resume allow the user to suspend and resume
  585.      BIOS interrupt timing  of  the specified interrupt(s).  All interrupts
  586.      to be timed must be installed by t_bios_start, but timing can  then be
  587.      immediately suspended by t_bios_suspend until the point in the program
  588.  
  589.  
  590.  
  591.                                     TCHRT  6
  592.  
  593.  
  594.  
  595.  
  596.  
  597.      that the user actually wants timing  to  begin, when it can be resumed
  598.      with t_bios_resume.
  599.  
  600.      t_bios_set_user enables the user to specify an interrupt  to  be timed
  601.      that has not been provided for by TCHRT.  Each interrupt that is timed
  602.      requires new interrupt  service  routine that when activated, starts a
  603.      timer, calls the old vector, then stops the appropriate timer.   TCHRT
  604.      provides new timer ISRs for the major device, EMS,  Mouse,  and  MSDOS
  605.      interrupts, along with  a  spare  ISR  that  can be used for any other
  606.      interrupt the user might want to time.   t_bios_set_user  assigns this
  607.      spare timer ISR to the specified interrupt, allowing the user  to time
  608.      any interrupt vector in the PC environment.   If  the  interrupt  is a
  609.      software interrupt that has specific functions (as requested by the AH
  610.      register when the  interrupt  is  invoked)  the  user  may  specify an
  611.      interrupt function description  file using t_bios_set_file which loads
  612.      a text file containing interrupt function descriptions if that file is
  613.      in the current directory.    Interrupt  function description files are
  614.      provided for all the software interrupts TCHRT has standard timer ISRs
  615.      for.
  616.  
  617.      t_bios_ask   and  t_bios_reset  function  like  their  generic   timer
  618.      counterparts and allow the user to request specific BIOS timer results
  619.      or to reset  those results to zero.
  620.  
  621.      t_bios_report, t_bios_rname, and  t_bios_fname modify and generate the
  622.      BIOS timer report in the same way as their generic  timer counterparts
  623.      t_report, t_rname, and  t_fname  generate and modify the generic timer
  624.      report.
  625.  
  626.      Be sure and carefully review the documentation for t_bios_start before
  627.      using the BIOS interrupt timing functions.
  628.  
  629.      Delay Functions
  630.  
  631.      This class of functions  implement  the  microsecond  resolution delay
  632.      functionality.
  633.  
  634.      t_ask_delay         Requests parameters for requested delay time.
  635.      t_do_delay          Executes delay with interrupts disabled.
  636.      t_do_delay_wints    Executes delay with interrupts enabled.
  637.      t_calc_delay_ff     Optimizes delay calibration to a specified
  638.                          delay duration.
  639.      t_get_delay_ff      Returns delay calibration optimization.
  640.      t_set_delay_ff      Sets current delay calibration optimization.
  641.      t_min_delay         Returns minimum delay possible with current
  642.                          hardware.
  643.      t_res_delay         Returns delay resolution possible with
  644.                          current hardware
  645.  
  646.      t_ask_delay   requests  delay  parameters  for  the  specified   delay
  647.      interval.    These  parameters  are  stored in a user allocated  TCHRT
  648.      defined  data structure and are passed  to  either  t_do_delay,  which
  649.      generates  the  delay  with  interrupts disabled, or t_do_delay_wints,
  650.      which generates the delay with interrupts enabled.
  651.  
  652.      t_calc_delay_ff,  t_set_delay_ff, and t_get_delay_ff, allows the  user
  653.      to  have  the  TCHRT  delay  logic  "fine  tune"  its calibration to a
  654.  
  655.  
  656.  
  657.                                     TCHRT  7
  658.  
  659.  
  660.  
  661.  
  662.  
  663.      particular delay interval.   t_calc_delay_ff  calculates  and installs
  664.      the  new  delay  calibration  optimization, t_set_delay_ff enables the
  665.      user  to   install   a   previously   calculated   optimization,   and
  666.      t_get_delay_ff retrieves the current delay optimization.
  667.  
  668.      t_min_delay returns the minimum  delay  possible  in the host run-time
  669.      environment.  t_res_delay returns the resolution of the delay function
  670.      in the host run-time environment.
  671.  
  672.  
  673.      Examples
  674.  
  675.  
  676.      While  the  accompanying  pages  spell  out the functions of TCHRT  in
  677.      detail, as the saying goes, "a picture is worth a thousand words".  In
  678.      keeping with that philosophy,  we  have  included several source files
  679.      that demonstrate different  areas  of TCHRT functionality. They are as
  680.      follows:
  681.  
  682.      DEMO             Basic  TCHRT operation.  Shows inline and  subroutine
  683.                       timing, report generation.
  684.  
  685.      TESTBIOS         BIOS interrupt timing.
  686.  
  687.      SEEKTEST         Hard disk seek  test  benchmark.    Uses  both inline
  688.                       timers and BIOS interrupt timing to  fully  test disk
  689.                       seek performance.
  690.  
  691.      DELAY            Demonstration of high resolution delay functionality.
  692.  
  693.      WATCH            Full function Taylor Split stopwatch.   Shows  how to
  694.                       activate timers with a user written interrupt service
  695.                       routine.
  696.  
  697.      These programs are carefully commented and  provide  valuable insights
  698.      into effective TCHRT operation.
  699.  
  700.  
  701.      Technical Support
  702.  
  703.  
  704.      Technical  support for licensed users of TCHRT  is  available  by  the
  705.      following methods:
  706.  
  707.         1.  By US Mail directed to P.O. Box 22, Mt. Pleasant MI 48804.
  708.  
  709.         2.  By   Compuserve  electronic   (Easyplex)   mail   directed   to
  710.             73047,1765.
  711.  
  712.  
  713.      Shareware
  714.  
  715.  
  716.      This software is distributed as "Shareware", which allows  you  to use
  717.      the complete product  on  an  evaluation  basis  to get a feel for its
  718.      quality, functionality, and value  to  you as a developer or end user.
  719.      At the end of your evaluation (14 days is a  widely  accepted time for
  720.  
  721.  
  722.  
  723.                                     TCHRT  8
  724.  
  725.  
  726.  
  727.  
  728.  
  729.      the evaluation period) you may continue to use the software product by
  730.      sending in a registration  fee  to  the  program author/vendor, or you
  731.      must discontinue use of the software and are free to pass your copy on
  732.      to another user for evaluation.   The Shareware concept allows quality
  733.      software  to   be  distributed  at  far  less  cost  than  traditional
  734.      commercial products, and allows the user to "try before you buy".
  735.  
  736.      TCHRT is a single language functional subset of PCHRT,  the  PC  Timer
  737.      Toolbox distributed through traditional  commercial  channels  by Ryle
  738.      Design.   MSCHRT for Microsoft C and TPHRT for  Turbo  Pascal are also
  739.      available as Shareware, and  provide  the  same  suite of functions as
  740.      TCHRT.
  741.  
  742.      Registration of TCHRT costs $20.00,  and in return users receive large
  743.      and small model object  libraries,  complete  library source code, and
  744.      technical support by US  Mail  and  Compuserv  Email.  Distribution of
  745.      TCHRT object code in commercial applications is not permitted.
  746.  
  747.      Users  developing commerical applications or needing additional  timer
  748.      functionality should purchase PCHRT, the commerical version  of TCHRT,
  749.      which costs $49.95.  PCHRT includes all the functions of  TCHRT, along
  750.      with three  new timer functions, five new synchronous alarm functions,
  751.      four functions to run the timer tick interrupt at a user defined rate,
  752.      and two utilities to  time  execution  and  profile interrupts of most
  753.      executable programs without recompilation.  PCHRT comes with libraries
  754.      for  Turbo  C  and MSC in small, medium, compact, and large models, as
  755.      well  as units for Turbo Pascal V5 and V5.5.  Full library source code
  756.      for both Pascal and C is provided, along  with  a  printed  manual and
  757.      telephone technical support.  Distribution  of  PCHRT  object  code in
  758.      commercial applications is permitted without royalties.
  759.  
  760.      An order form  for  these  products  appears  as the last page of this
  761.      document.
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.                                     TCHRT  9
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.  
  801.  
  802.  
  803.  
  804.  
  805.  
  806.  
  807.  
  808.  
  809.  
  810.  
  811.  
  812.  
  813.  
  814.  
  815.  
  816.  
  817.  
  818.  
  819.  
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.                                     TCHRT  10
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.  
  866.  
  867.                             TCHRT Function Reference
  868.  
  869.  
  870.      t_ask_delay
  871.  
  872.  
  873.      Purpose          Fills delay parameter structure with  required values
  874.                       for requested delay interval
  875.  
  876.      C                void  t_ask_delay(long  unsigned  usec,  t_delay_type
  877.                       *dp)
  878.  
  879.      Synopsis         Parameters accepted by the delay functions are stored
  880.                       in  a  TCHRT  defined,  user allocated data structure
  881.                       tdelay_type.   t_ask_delay accepts the desired  delay
  882.                       interval  in  microseconds,  and  fills   the  passed
  883.                       tdelay_type structure with the appropriate parameters
  884.                       to generate the requested delay.  This data structure
  885.                       is    then    passed    to   either   t_do_delay   or
  886.                       t_do_delay_wints,   where   the   actual   delay   is
  887.                       generated.
  888.  
  889.      Caveat           None
  890.  
  891.      See Also         t_do_delay, t_do_delay_wints
  892.  
  893.  
  894.      t_ask_timer
  895.  
  896.  
  897.      Purpose          Returns activation  and  elapsed  time  count  for  a
  898.                       specified timer
  899.  
  900.      C                void t_ask_timer(int tnum, long unsigned  *hits, long
  901.                       unsigned *elapsed)
  902.  
  903.      Synopsis         The  user may retrieve activation counts and  elapsed
  904.                       time  (in  microseconds)  for  the  specified  timer.
  905.                       Timers are specified from 0 to n-1 in C and from 1 to
  906.                       n in Pascal.  The number of timers n defaults  to 10,
  907.                       but t_request  may  be  called  prior  to  t_start to
  908.                       increase that number.
  909.  
  910.      Caveat           No range  checking is done.  A NULL pointer reference
  911.                       is possible if information on a non-existant timer is
  912.                       requested.
  913.  
  914.      See Also         t_request, t_reset
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.                                     TCHRT  11
  922.  
  923.  
  924.  
  925.  
  926.  
  927.      t_bios_ask
  928.  
  929.  
  930.      Purpose          Returns activation count and elapsed time for  one or
  931.                       all functions associated with a BIOS interrupt timer
  932.  
  933.      C                void  t_bios_ask(int  whichint, int  whichfunc,  long
  934.                       unsigned *hits, long unsigned elapsed)
  935.  
  936.      Synopsis         The users passes a single BIOS  timer  interrupt mask
  937.                       (see  t_bios_start) and either an interrupt  function
  938.                       in the range of 0 to 255 or -1, which causes  all the
  939.                       interrupt   function  timers  to  be  summed.     The
  940.                       accumulated number of activations and elapsed time in
  941.                       microseconds is returned.
  942.  
  943.                       The summation of all function  timers  by  passing -1
  944.                       feature is useful if a hardware  interrupt  that does
  945.                       not have specific function  classes  is  being timed.
  946.                       Interrupt functions are  specified by the contents of
  947.                       the  AH  register,  and  since  the  AH  register may
  948.                       contain  random, non-specific values when a  hardware
  949.                       interrupt  is invoked, many timers for the  interrupt
  950.                       will show some activity.   These  must  be  summed in
  951.                       order to  determine  the  activity  of  the  hardware
  952.                       interrupt.
  953.  
  954.      Caveat           No range  checking is done.  A NULL pointer reference
  955.                       is possible if information is  requested  on  an non-
  956.                       existant interrupt timer.
  957.  
  958.      See Also         t_bios_start, t_bios_reset
  959.  
  960.  
  961.      t_bios_entry
  962.  
  963.  
  964.      Purpose          Receives  timer  start  requests  from  an  interrupt
  965.                       service routine
  966.  
  967.      C                void t_bios_entry(int whichint, int whichfunc)
  968.  
  969.      Synopsis         BIOS interrupt vectors  being timed call this routine
  970.                       to start the appropriate  timer  for  this interrupt.
  971.                       Parameter whichfunc is the value in  the  AH register
  972.                       when   the  interrupt  was  invoked,  which  is   the
  973.                       interrupt function requested in a software interrupt.
  974.  
  975.      Caveat           This is  an internal TCHRT procedure and is not meant
  976.                       to be called by the user.
  977.  
  978.      See Also         t_bios_exit
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.                                     TCHRT  12
  988.  
  989.  
  990.  
  991.  
  992.  
  993.      t_bios_exit
  994.  
  995.  
  996.      Purpose          Receives  interrupt  timer  stop  requests   from  an
  997.                       interrupt service routine
  998.  
  999.      C                void t_bios_exit(int whichint)
  1000.  
  1001.      Synopsis         BIOS interrupt vectors call this routine to  stop the
  1002.                       appropriate timer for this  interrupt.    The current
  1003.                       active function timer  for this interrupt is stopped,
  1004.                       and  if  the  interrupt  was entered recursively, the
  1005.                       previous function timer is restarted.
  1006.  
  1007.      Caveat           This is  an internal TCHRT procedure and is not meant
  1008.                       to be called by the user.
  1009.  
  1010.      See Also         t_bios_entry
  1011.  
  1012.  
  1013.      t_bios_fname
  1014.  
  1015.  
  1016.      Purpose          Specifies a name for the  disk  file  created  by the
  1017.                       BIOS timer report if the disk  destination  option is
  1018.                       selected
  1019.  
  1020.      C                void t_bios_fname(char *fname)
  1021.  
  1022.      Synopsis         By calling t_bios_report(1)  the BIOS timer report is
  1023.                       generated  and  sent  to  an  ASCII disk file.    The
  1024.                       default  name   for   this   file   is  BIOSTIME.TXT.
  1025.                       t_bios_fname  allows the user to specify a  different
  1026.                       filename,   with   complete   disk,  path,  and  file
  1027.                       specification.
  1028.  
  1029.      Caveat           Maximum  disk/path/filename  string   length   is  67
  1030.                       characters
  1031.  
  1032.      See Also         t_bios_report
  1033.  
  1034.  
  1035.      t_bios_load_desc
  1036.  
  1037.  
  1038.      Purpose          Loads   an   interrupt   description  file  into  the
  1039.                       appropriate interrupt timer data structure
  1040.  
  1041.      C                void t_bios_load_desc(int whichint, char *data_file)
  1042.  
  1043.      Synopsis         Each  interrupt  vector  being  timed   contains  256
  1044.                       timers,  one for each possible interrupt function  as
  1045.                       indicated  by  the  AH   register.      An  interrupt
  1046.                       description  file  contains  brief  twenty  character
  1047.                       descriptions  of  each  interrupt  function,  and  if
  1048.                       loaded, these will appear  along  with  the interrupt
  1049.                       function  number in the BIOS interrupt timer  report.
  1050.  
  1051.  
  1052.  
  1053.                                     TCHRT  13
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.                       whichint   is  a  BIOS  timer  interrupt  mask   (see
  1060.                       t_bios_start),  and  data_file  is the disk/path/file
  1061.                       descriptor.  No error is generated  if  the specified
  1062.                       file is not found.
  1063.  
  1064.                       See  one of the supplied interrupt description  files
  1065.                       (such as 10.INT) for the layout of these files.
  1066.  
  1067.                       This routine is called automatically by t_bios_start.
  1068.  
  1069.      Caveat           No range checking is done.  NULL pointer reference is
  1070.                       possible.
  1071.  
  1072.      See Also         t_bios_start, t_bios_set_file
  1073.  
  1074.  
  1075.      t_bios_report
  1076.  
  1077.  
  1078.      Purpose          Generates BIOS interrupt timer report
  1079.  
  1080.      C                void t_bios_report(int whereto)
  1081.  
  1082.      Synopsis         This routine generates a  complete  timer  report for
  1083.                       all active BIOS  interrupt timers.  whereto specifies
  1084.                       the report's  destination - 0 sends the report to the
  1085.                       display, 1 to a disk file, and 2 to a printer.
  1086.  
  1087.      Caveat           None.
  1088.  
  1089.      See Also         t_bios_rname, t_bios_fname
  1090.  
  1091.  
  1092.      t_bios_resume
  1093.  
  1094.  
  1095.      Purpose          Resumes suspended BIOS interrupt timing
  1096.  
  1097.      C                void t_bios_resume(int biosmask)
  1098.  
  1099.      Synopsis         This  routine  enables   previously   suspended  BIOS
  1100.                       interrupt  timing.  biosmask contains the BIOS  timer
  1101.                       bitmask (see t_bios_start)  of the interrupts to have
  1102.                       timing re-enabled.
  1103.  
  1104.      Caveat           No range checking is done.  NULL pointer reference is
  1105.                       possible if a interrupt is  referenced  that  was not
  1106.                       setup by t_bios_start.
  1107.  
  1108.      See Also         t_bios_suspend, t_bios_start
  1109.  
  1110.  
  1111.      t_bios_reset
  1112.  
  1113.  
  1114.      Purpose          Resets one or  all  timers  associated  with  a timed
  1115.                       interrupt
  1116.  
  1117.  
  1118.  
  1119.                                     TCHRT  14
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.      C                void t_bios_reset(int whichint, int whichfunc)
  1126.  
  1127.      Synopsis         This function allows the  user  to  reset  either one
  1128.                       specific  or  all  function  timers associated with a
  1129.                       timed interrupt.  Specific function timers are in the
  1130.                       range of 0 to 255.  Passing -1  for  whichfunc resets
  1131.                       all  256  timers  associated  with a timed interrupt.
  1132.                       The interrupt is specified  by  whichint  which  is a
  1133.                       single BIOS interrupt timer mask (see t_bios_start).
  1134.  
  1135.      Caveat           No range checking is done.  NULL pointer reference is
  1136.                       possible   if  a  non-existant  interrupt  timer   is
  1137.                       specified.
  1138.  
  1139.      See Also         t_bios_start, t_bios_ask
  1140.  
  1141.  
  1142.      t_bios_rname
  1143.  
  1144.  
  1145.      Purpose          Specifies title for BIOS timer report
  1146.  
  1147.      C                void t_bios_rname(char *rname)
  1148.  
  1149.      Synopsis         This function  allows the user to specify a title for
  1150.                       the  BIOS  interrupt  timer  report.    If   none  is
  1151.                       specified,  the  title  used  is Bios Interrupt Timer
  1152.                       Summary.  The title is horizontally centered.
  1153.  
  1154.      Caveat           Max string length is 80 characters.
  1155.  
  1156.      See Also         t_bios_report, t_bios_fname
  1157.  
  1158.  
  1159.      t_bios_set_file
  1160.  
  1161.  
  1162.      Purpose          Sets the interrupt  function description file for the
  1163.                       user specified interrupt timer
  1164.  
  1165.      C                void t_bios_set_file(char *user_int_file)
  1166.  
  1167.      Synopsis         When a user specifies the optional interrupt  to time
  1168.                       using  t_bios_set_user, a file of interrupt  function
  1169.                       descriptions   may  also  be  specified  using   this
  1170.                       function.
  1171.  
  1172.      Caveat           Max file description length is 67 characters.
  1173.  
  1174.      See Also         t_bios_load_desc, t_bios_set_file
  1175.  
  1176.  
  1177.      t_bios_set_user
  1178.  
  1179.  
  1180.      Purpose          Specifies the optional interrupt to time
  1181.  
  1182.  
  1183.  
  1184.  
  1185.                                     TCHRT  15
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.      C                void t_bios_set_user(int user_int)
  1192.  
  1193.      Synopsis         The  TCHRT  BIOS timing functionality  has  built  in
  1194.                       support for the various BIOS interrupts of interest -
  1195.                       disk, CRT, serial,  parallel, DOS, EMS, keyboard, and
  1196.                       mouse.   This function allows the user to specify any
  1197.                       other interrupt to be timed, and when t_bios_start is
  1198.                       invoked with the  USER  bit set in the timer bitmask,
  1199.                       the interrupt specified by t_bios_set_user  will have
  1200.                       timers inserted in its vector.
  1201.  
  1202.      Caveat           The  ISR  supplied  that  is  hooked  into  the  user
  1203.                       specified interrupt (t_new_user in the  .ASM modules)
  1204.                       does not propagate the  FLAGS  register.   If you are
  1205.                       attempting to time  a software interrupt that returns
  1206.                       meaningful information  in  the  FLAGS  register, you
  1207.                       should  modify  the  t_new_user  routine so that it's
  1208.                       last instruction is a RETF 2 instead of  IRET.   This
  1209.                       is documented in the t_new_user code.
  1210.  
  1211.      See Also         t_bios_start, t_bios_set_file
  1212.  
  1213.  
  1214.      t_bios_start
  1215.  
  1216.  
  1217.      Purpose          Initializes BIOS interrupt timing
  1218.  
  1219.      C                int t_bios_start(int biosmask)
  1220.  
  1221.      Synopsis         This function initializes BIOS interrupt timing.  The
  1222.                       interrupts to be timed are  selected  by  passing the
  1223.                       appropriate bitmask:
  1224.  
  1225.                       CRT10       INT 10h Video Services
  1226.  
  1227.                       DISK        INT 13h Disk Services
  1228.  
  1229.                       COM         INT 14h Serial Port Services
  1230.  
  1231.                       KEYBD       INT 16h Keyboard Services
  1232.  
  1233.                       PRT         INT 17h Printer Services
  1234.  
  1235.                       DOS21       INT 21h MSDOS System Services
  1236.  
  1237.                       MOUSE       INT 33h Mouse Services
  1238.  
  1239.                       EMS         INT 67h EMS Services
  1240.  
  1241.                       USER        User Specified Interrupt
  1242.  
  1243.                       As an  example, to insert timers in the DOS interrupt
  1244.                       and   the   disk   interrupt,   one    would   invoke
  1245.                       t_bios_start(DISK+DOS21).
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.                                     TCHRT  16
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.                       Each  interrupt timed  actually  has  256  individual
  1258.                       timers,  one  for  each  possible  value  in  the  AH
  1259.                       register,  which indicates what specific function  of
  1260.                       that interrupt has been requested.    The  timer data
  1261.                       structure   is   allocated  dynamically,   and   each
  1262.                       structure requires approximately 9200 bytes, so there
  1263.                       is a limit imposed by  the memory model being used as
  1264.                       to  how  many  interrupt  timers  may  be  requested.
  1265.                       t_bios_start returns FALSE  in  C  if  the  amount of
  1266.                       memory  needed  is not available,  while  a  run-time
  1267.                       error occurs in Turbo Pascal.
  1268.  
  1269.                       If the USER bitmask is  to  be  used, t_bios_set_user
  1270.                       must  be  invoked  prior  to t_bios_start to indicate
  1271.                       what interrupt the USER bitmask will time.
  1272.  
  1273.                       Interrupt   function   description  files   for   the
  1274.                       supported interrupts are supplied, and will be loaded
  1275.                       if they are present  in  the  run-time directory.  As
  1276.                       these  will  dramatically  improve  the   information
  1277.                       presented in the BIOS  interrupt  timer  report, they
  1278.                       are  recommended.  t_bios_set_file associates a  file
  1279.                       with the USER selected interrupt.
  1280.  
  1281.                       If testing code with  BIOS  interrupt  timing active,
  1282.                       and the code fails prior to calling t_bios_stop, then
  1283.                       you  should immediately reboot your computer, as  the
  1284.                       interrupt vectors being timed  are  pointing  to non-
  1285.                       existant code.
  1286.  
  1287.      Caveat           Approximately  9200  bytes  are  required   for  each
  1288.                       interrupt to be timed.  Memory constraints can affect
  1289.                       this function.
  1290.  
  1291.      See Also         t_bios_stop,     t_bios_set_user,    t_bios_set_file,
  1292.                       t_bios_suspend, t_bios_resume
  1293.  
  1294.  
  1295.      t_bios_stop
  1296.  
  1297.  
  1298.      Purpose          Stops all BIOS interrupt timing
  1299.  
  1300.      C                void t_bios_stop(void)
  1301.  
  1302.      Synopsis         This  function removes all timers from all  interrupt
  1303.                       vectors selected by t_bios_start and  deallocates all
  1304.                       memory associated with those timers.
  1305.  
  1306.      Caveat           This function must be called prior to program exit in
  1307.                       order to restore the interrupt environment.    If the
  1308.                       code under  test  fails  prior  to  t_bios_start  the
  1309.                       interrupt  vectors  being  timed  will be pointing to
  1310.                       non-existant code, and a system hang is likely.
  1311.  
  1312.      See Also         t_bios_start, t_bios_suspend, t_bios_resume
  1313.  
  1314.  
  1315.  
  1316.  
  1317.                                     TCHRT  17
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.      t_bios_suspend
  1324.  
  1325.  
  1326.      Purpose          Suspends interrupt timing selected by t_bios_start
  1327.  
  1328.      C                void t_bios_suspend(int biosmask)
  1329.  
  1330.      Synopsis         BIOS  interrupt timing is initiated by  t_bios_start,
  1331.                       and terminated by t_bios_stop.   t_bios_suspend gives
  1332.                       the user the ability to selectively disable timing on
  1333.                       a particular interrupt or  interrupts  by  passing an
  1334.                       appropriate  biosmask  (see   t_bios_start).     This
  1335.                       suspended interrupt timing may  be  later  resumed by
  1336.                       invoking t_bios_resume.
  1337.  
  1338.      Caveat           No range checking is done.  NULL pointer reference is
  1339.                       possible   if  a  non-existant  interrupt  timer   is
  1340.                       referenced.
  1341.  
  1342.      See Also         t_bios_resume, t_bios_start, t_bios_stop
  1343.  
  1344.  
  1345.      t_calc_delay_ff
  1346.  
  1347.  
  1348.      Purpose          Optimizes  delay calibration  for  a  specific  delay
  1349.                       interval
  1350.  
  1351.      C                float t_calc_delay_ff(long  unsigned  delay_time, int
  1352.                       ints_or_not)
  1353.  
  1354.      Synopsis         This  function  optimizes  delay  calibration   to  a
  1355.                       specific  delay interval.  ints_or_not can be  either
  1356.                       INTS_ON,  indicating a delay with interrupts  enabled
  1357.                       should  be used for the optimization calculation,  or
  1358.                       NO_INTS_ON,   which  indicates  that  a  delay   with
  1359.                       interrupts disabled should be  used.    This function
  1360.                       sets a  global value that is used by t_ask_delay, and
  1361.                       the value is also returned,  so that it may be stored
  1362.                       for later use with the delay interval optimized.
  1363.  
  1364.      Caveat           None
  1365.  
  1366.      See Also         t_set_delay_ff, t_get_delay_ff, t_ask_delay
  1367.  
  1368.  
  1369.      t_calib
  1370.  
  1371.  
  1372.      Purpose          Calibrates the TCHRT timer and delay logic
  1373.  
  1374.      C                void t_calib(void)
  1375.  
  1376.      Synopsis         This function calibrates the  low  level  TCHRT timer
  1377.                       and delay logic.   It  is  called  by t_start, so the
  1378.                       user  need  not  explicitly  call this routine unless
  1379.                       additional delay calibration is needed after a system
  1380.  
  1381.  
  1382.  
  1383.                                     TCHRT  18
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.                       parameter has been  modified  during a timing run - a
  1390.                       keyboard initiated system clock  speed  change  is an
  1391.                       example.    t_calib  calls t_delay_calib to calibrate
  1392.                       the TCHRT delay logic.
  1393.  
  1394.      Caveat           None
  1395.  
  1396.      See Also         t_delay_calib
  1397.  
  1398.  
  1399.      t_cvt_time
  1400.  
  1401.  
  1402.      Purpose          Converts a microsecond count to a MM:SS.xxxxxx format
  1403.                       string
  1404.  
  1405.      C                char    *t_cvt_time(long    unsigned    usecs,   char
  1406.                       *time_string)
  1407.  
  1408.      Synopsis         This function accepts a microsecond count and returns
  1409.                       a printable character string in a simple time format.
  1410.                       This function is useful to  the  user  who  wishes to
  1411.                       build custom timer reports.
  1412.  
  1413.      Caveat           Destination string length should be 13 characters.
  1414.  
  1415.      See Also         t_ask_timer, t_bios_ask
  1416.  
  1417.  
  1418.      t_delay_calib
  1419.  
  1420.  
  1421.      Purpose          Calibrates the TCHRT delay logic
  1422.  
  1423.      C                void t_delay_calib(void)
  1424.  
  1425.      Synopsis         This  function  calibrates the delay  loops  used  to
  1426.                       generate  precision  microsecond  delays.  Additional
  1427.                       calibration   is   available   from  t_calc_delay_ff.
  1428.                       t_delay_calib is called by t_calib, so the  user need
  1429.                       not call it explicitly.
  1430.  
  1431.      Caveat           None
  1432.  
  1433.      See Also         t_calib, t_calc_delay_ff
  1434.  
  1435.  
  1436.      t_diff
  1437.  
  1438.  
  1439.      Purpose          Calculates  the difference  between  two  TCHRT  time
  1440.                       stamps
  1441.  
  1442.      C                long  unsigned  t_diff(TCHRT_type  *start, TCHRT_type
  1443.                       *stop)
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.                                     TCHRT  19
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.      Synopsis         This function returns the difference  in microseconds
  1456.                       between two TCHRT time stamps, which are generated by
  1457.                       calls  to  t_get.   t_diff and t_get  are  low  level
  1458.                       functions  that  are  of  interest primarily to users
  1459.                       building timer functions not implemented in TCHRT.
  1460.  
  1461.      Caveat           Don't pass the time stamps in the wrong order.
  1462.  
  1463.      See Also         t_get
  1464.  
  1465.  
  1466.      t_do_delay
  1467.  
  1468.  
  1469.      Purpose          Generates   a   precision  microsecond   delay   with
  1470.                       interrupts disabled
  1471.  
  1472.      C                void t_do_delay(tdelay_type *delay_params)
  1473.  
  1474.      Synopsis         This function generates a precision microsecond delay
  1475.                       with interrupts disabled.   Using  this  function for
  1476.                       delays greater than 54925 microseconds will cause the
  1477.                       PC  clock to lose time.   Delay  parameters  of  type
  1478.                       tdelay_type for  the  delay  interval  desired    are
  1479.                       generated by t_ask_delay.
  1480.  
  1481.                       Delay interval error will be in the range  of  one to
  1482.                       three percent if t_calc_delay_ff is not used, zero to
  1483.                       one percent if it is.
  1484.  
  1485.      Caveat           Interrupts are disabled during the delay period
  1486.  
  1487.      See Also         t_ask_delay, t_calc_delay_ff, t_do_delay_wints
  1488.  
  1489.  
  1490.      t_do_delay_wints
  1491.  
  1492.  
  1493.      Purpose          Generates   a   precision  microsecond   delay   with
  1494.                       interrupts enabled
  1495.  
  1496.      C                void t_do_delay_wints(tdelay_type : *delay_params)
  1497.  
  1498.      Synopsis         This function is  identical to t_do_delay except that
  1499.                       interrupts are  enabled  during  the  delay interval.
  1500.                       This  will  introduce some additional  error  in  the
  1501.                       delay produced, but is more appropriate for  longer (
  1502.                       > 54925  usec)  delays.    Delay  parameters  of type
  1503.                       tdelay_type for  the  delay  interval  desired    are
  1504.                       generated by t_ask_delay.
  1505.  
  1506.                       Delay interval error will be in the range  of  one to
  1507.                       three percent if t_calc_delay_ff is not used, zero to
  1508.                       one percent if it is.
  1509.  
  1510.      Caveat           Interrupt  activity  may  cause  random errors in the
  1511.                       delay interval produced.
  1512.  
  1513.  
  1514.  
  1515.                                     TCHRT  20
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.      See Also         t_do_delay, t_ask_delay, t_calc_delay_ff
  1522.  
  1523.  
  1524.      t_entry
  1525.  
  1526.  
  1527.      Purpose          Starts the specified general purpose timer
  1528.  
  1529.      C                void t_entry(int timernum)
  1530.  
  1531.      Synopsis         This   function   starts   a  general  purpose  timer
  1532.                       counting.  Timers are specified from 0 to  n-1  in C,
  1533.                       and from 1  to  n  in  Pascal.  The default number of
  1534.                       timers  is  10,  but that can be  modified  prior  to
  1535.                       calling t_start  by  passing  the  number  of  timers
  1536.                       needed to t_request.
  1537.  
  1538.                       Interrupts  are  normally  enabled  during  a  timing
  1539.                       interval.    t_setmode  can   be   used   to  disable
  1540.                       interrupts during any or all timing intervals.
  1541.  
  1542.      Caveat           No range checking is done.    NULL  pointer reference
  1543.                       possible if non-existant timer is started.
  1544.  
  1545.      See Also         t_exit, t_setmode
  1546.  
  1547.  
  1548.  
  1549.      t_exit
  1550.  
  1551.  
  1552.      Purpose          Stops the specified general purpose timer
  1553.  
  1554.      C                void t_exit(int timernum)
  1555.  
  1556.      Synopsis         This function stops a general purpose timer counting.
  1557.                       Activation count and accumulated elapsed time for the
  1558.                       specified  timer  is  updated.   Timers are specified
  1559.                       from  0 to n-1 in C, and from 1 to n in Pascal.   The
  1560.                       default  number  of  timers is 10, but  that  can  be
  1561.                       modified  prior  to calling t_start  by  passing  the
  1562.                       number of timers needed to t_request.
  1563.  
  1564.      Caveat           No range checking is done.    NULL  pointer reference
  1565.                       possible if non-existant timer is started.
  1566.  
  1567.      See Also         t_entry
  1568.  
  1569.  
  1570.      t_fname
  1571.  
  1572.  
  1573.      Purpose          Changes name of timer report file
  1574.  
  1575.      C                void t_fname(char *filename)
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.                                     TCHRT  21
  1582.  
  1583.  
  1584.  
  1585.  
  1586.  
  1587.      Synopsis         t_report can send its  output  to  a disk file, which
  1588.                       has the default name TIMER.TXT.  This function allows
  1589.                       the user to assign a different disk/path/file name to
  1590.                       this file.
  1591.  
  1592.      Caveat           No  checking  is  done  to  determine  if   the  file
  1593.                       description is valid.  Maximum  string  length  is 67
  1594.                       characters.
  1595.  
  1596.      See Also         t_rname, t_report
  1597.  
  1598.  
  1599.      t_get
  1600.  
  1601.  
  1602.      Purpose          Retrieves  a   high   resolution   time   stamp  with
  1603.                       interrupts enabled
  1604.  
  1605.      C                void t_get(TCHRT_type *timestamp)
  1606.  
  1607.      Synopsis         This function interrogates the  8253  timer  chip and
  1608.                       the low 16  bits  of  the  DOS time of day data words
  1609.                       fills  the passed TCHRT_type data structure with  the
  1610.                       microsecond  resolution  timestamp.    This   is  the
  1611.                       fundamental unit of time for TCHRT.  The elapsed time
  1612.                       between two TCHRT_type  time stamps may be determined
  1613.                       by t_diff.
  1614.  
  1615.      Caveat           Interrupts are enabled when t_get returns.
  1616.  
  1617.      See Also         t_hires_entry, t_hires_exit
  1618.  
  1619.  
  1620.      t_get_delay_ff
  1621.  
  1622.  
  1623.      Purpose          Retrieves the current delay calibration optimization
  1624.  
  1625.      C                float t_get_delay_ff(void)
  1626.  
  1627.      Synopsis         t_calc_delay_ff  calculates  and  installs  a   delay
  1628.                       calibration  optimization  for   a   specified  delay
  1629.                       interval length.  Using this  additional optimization
  1630.                       can  vastly  improve  the  TCHRT  delay  accuracy  in
  1631.                       critical  applications.    t_get_delay_ff returns the
  1632.                       current  delay  calibration optimization  in  effect.
  1633.                       The default value (i.e. - no additional optimization)
  1634.                       is 1.00.
  1635.  
  1636.      Caveat           None
  1637.  
  1638.      See Also         t_calc_delay_ff, t_set_delay_ff
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.                                     TCHRT  22
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.      t_hires_entry
  1654.  
  1655.  
  1656.      Purpose          Initiates timing with interrupts disabled
  1657.  
  1658.      C                void t_hires_entry(TCHRT_type *timestamp)
  1659.  
  1660.      Synopsis         This   function,   like   t_get,  retrieves  a  TCHRT
  1661.                       timestamp from the timing  hardware.    Unlike t_get,
  1662.                       t_hires_entry resets the 8253 timer  chip  to  0, and
  1663.                       interrupts are disabled at exit.  This  facilitates a
  1664.                       timing mode (set by  t_setmode)  that  functions with
  1665.                       interrupts disabled.
  1666.  
  1667.      Caveat           Since the 8253 is reset, only one timer may be active
  1668.                       at  any  one  time.  The timer will "roll over" after
  1669.                       54925  usec,  so  this  mode  is  suitable  for short
  1670.                       duration timing  only.  This is a low level function,
  1671.                       and is not meant to be called by the user.
  1672.  
  1673.      See Also         t_hires_exit, t_setmode
  1674.  
  1675.  
  1676.      t_hires_exit
  1677.  
  1678.  
  1679.      Purpose          Concludes a timing interval with interrupts disabled
  1680.  
  1681.      C                void t_hires_exit(TCHRT_type *timestamp)
  1682.  
  1683.      Synopsis         This  is the companion function to t_hires_entry  and
  1684.                       completes a timing interval with interrupts disabled.
  1685.                       At exit interrupts are enabled.
  1686.  
  1687.      Caveat           See t_hires_entry.
  1688.  
  1689.      See Also         t_hires_entry, t_setmode
  1690.  
  1691.  
  1692.      t_hook_int
  1693.  
  1694.  
  1695.      Purpose          Installs timers in the specified interrupt vector
  1696.  
  1697.      C                void t_hook_int(int int_no)
  1698.  
  1699.      Synopsis         This  function  installs  timers  in   the  specified
  1700.                       interrupt  vector  to enable precise  timing  of  the
  1701.                       interrupt activity.
  1702.  
  1703.      Caveat           This is a low  level  function and is not meant to be
  1704.                       called by  the user.  Users wishing to understand how
  1705.                       TCHRT interrupt timing is accomplished should inspect
  1706.                       the source code to this routine.
  1707.  
  1708.      See Also         t_unhook_int
  1709.  
  1710.  
  1711.  
  1712.  
  1713.                                     TCHRT  23
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.      t_min_delay
  1720.  
  1721.  
  1722.      Purpose          Returns   minimum   delay   possible   in    run-time
  1723.                       environment
  1724.  
  1725.      C                long unsigned t_min_delay(void)
  1726.  
  1727.      Synopsis         The minimum delay interval that can  be  generated by
  1728.                       t_do_delay  or t_do_delay_wints varies with the  run-
  1729.                       time hardware environment.  This function returns the
  1730.                       minimum  delay in microseconds that can be  generated
  1731.                       in the current environment.
  1732.  
  1733.      Caveat           None
  1734.  
  1735.      See Also         t_res_delay
  1736.  
  1737.  
  1738.      t_name
  1739.  
  1740.  
  1741.      Purpose          Associates a descriptive string with a generic timer
  1742.  
  1743.      C                void t_name(int timerno, char *timername)
  1744.  
  1745.      Synopsis         This  functions  assigns   a  string  of  maximum  20
  1746.                       characters to the specified generic timer number, and
  1747.                       this string  is  then  displayed  next  to  the timer
  1748.                       number in the timer report generated by t_report.
  1749.  
  1750.      Caveat           Maximum string length is 20 characters.
  1751.  
  1752.      See Also         None
  1753.  
  1754.  
  1755.      t_report
  1756.  
  1757.  
  1758.      Purpose          Generates a report of all generic timer activity
  1759.  
  1760.      C                void t_report(int whereto)
  1761.  
  1762.      Synopsis         This  function  generates   a  report  of  all  timer
  1763.                       activity that was generated using t_entry and t_exit.
  1764.                       Parameter whereto specifies the report's destination:
  1765.                       0 sends the report to the CRT display, 1 sends  it to
  1766.                       a  disk file, and 2 sends it to  the  printer.    The
  1767.                       report  may  have  a  title  (see  t_rname),  and the
  1768.                       destination  disk   file   (if   used)   defaults  to
  1769.                       TIMER.TXT, but this can modified (see t_fname).
  1770.  
  1771.                       Timer  reports  have   two  formats,  and  these  are
  1772.                       selected by t_set_report.   The HIGHWATER report type
  1773.                       shows  the  activity  of  all timers, including those
  1774.                       with zero activation counts, up to the highest number
  1775.  
  1776.  
  1777.  
  1778.  
  1779.                                     TCHRT  24
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.                       timer activated.  The NONZERO report type  only shows
  1786.                       timers with nonzero activation counts.
  1787.  
  1788.      Caveat           None
  1789.  
  1790.      See Also         t_rname, t_fname, t_set_report
  1791.  
  1792.  
  1793.      t_request
  1794.  
  1795.  
  1796.      Purpose          Request specific number of generic timers
  1797.  
  1798.      C                void t_request(int numtimer)
  1799.  
  1800.      Synopsis         t_request  provides  a  mechanism  to   override  the
  1801.                       default   number  of  generic  timers  allocated   by
  1802.                       t_start.  If the user requires more (or less) than 10
  1803.                       timers,   the  number  required  may  be  passed   to
  1804.                       t_request, and t_start  will attempt to allocate this
  1805.                       number of timers.
  1806.  
  1807.      Caveat           Call before t_start.
  1808.  
  1809.      See Also         t_start
  1810.  
  1811.  
  1812.      t_res_delay
  1813.  
  1814.  
  1815.      Purpose          Retrieves delay resolution of run-time environment
  1816.  
  1817.      C                long unsigned t_res_delay(void)
  1818.  
  1819.      Synopsis         In slower hardware environments, the delay resolution
  1820.                       of t_do_delay  and  t_do_delay_wints  may  be several
  1821.                       microseconds.   This  function  returns  the run-time
  1822.                       delay resolution in units of tenths of a microsecond.
  1823.                       For example, if t_res_delay returns  a  value  of 44,
  1824.                       that means the delay  functions  can  generate delays
  1825.                       starting  at   their   minimum   delay   length  (see
  1826.                       t_min_delay)   and   up    in   increments   of   4.4
  1827.                       microseconds.
  1828.  
  1829.      Caveat           None
  1830.  
  1831.      See Also         t_min_delay
  1832.  
  1833.  
  1834.      t_reset
  1835.  
  1836.  
  1837.      Purpose          Resets one or all generic timers
  1838.  
  1839.      C                void t_reset(int timernum)
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.                                     TCHRT  25
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.      Synopsis         This  function  zeros  the accumulated activation and
  1852.                       elapsed timer counts for  a  specified  timer  in the
  1853.                       range of 0  to  n-1 in C, or 1 to n in Pascal.  If -1
  1854.                       is passed, all generic timers are reset.
  1855.  
  1856.      Caveat           No range checking is done.  Null pointer reference is
  1857.                       possible if a non-existant timer is specified.
  1858.  
  1859.      See Also         t_ask_timer
  1860.  
  1861.  
  1862.      t_resume
  1863.  
  1864.  
  1865.      Purpose          Resumes a suspended generic timer
  1866.  
  1867.      C                void t_resume(int tnum)
  1868.  
  1869.      Synopsis         Functions t_suspend and t_resume  allow  the  user to
  1870.                       stop and restart an active timer without incrementing
  1871.                       its activation count.
  1872.  
  1873.      Caveat           No range checking is done.  NULL pointer reference is
  1874.                       possible if a non-existant timer is specified.
  1875.  
  1876.      See Also         t_suspend
  1877.  
  1878.  
  1879.      t_rname
  1880.  
  1881.  
  1882.      Purpose          Assigns a title to the timer report
  1883.  
  1884.      C                void t_rname(char *report_title)
  1885.  
  1886.      Synopsis         The  generic  timer  report  generated   by  t_report
  1887.                       contains   a   horizontally   centered  title,  which
  1888.                       defaults to Timer Summary.  This function  allows the
  1889.                       user to specify an alternate title.
  1890.  
  1891.      Caveat           Max string length is 80 characters.
  1892.  
  1893.      See Also         t_report, t_fname
  1894.  
  1895.  
  1896.      t_set_delay_ff
  1897.  
  1898.  
  1899.      Purpose          Sets delay calibration optimization
  1900.  
  1901.      C                void t_set_delay_ff(float delay_ff)
  1902.  
  1903.      Synopsis         This function allows the  user  to  set the new delay
  1904.                       calibration  optimization  for  use  by  t_ask_delay.
  1905.                       Delay  calibration optimization  for  a  given  delay
  1906.                       interval  can be automatically calculated and set  by
  1907.                       t_calc_delay_ff.  Calling t_set_delay_ff with a value
  1908.  
  1909.  
  1910.  
  1911.                                     TCHRT  26
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.                       of  1.00  removes  any delay calibration optimization
  1918.                       that was in effect.
  1919.  
  1920.      Caveat           None
  1921.  
  1922.      See Also         t_calc_delay_ff, t_get_delay_ff, t_ask_delay
  1923.  
  1924.  
  1925.      t_setmode
  1926.  
  1927.  
  1928.      Purpose          Sets generic timing mode
  1929.  
  1930.      C                void t_setmode(int modetype)
  1931.  
  1932.      Synopsis         Two modes of generic  timing  are  available: INTS_ON
  1933.                       enables generic timing  using t_entry and t_exit with
  1934.                       interrupts  enabled,  and  this  is the default mode.
  1935.                       NO_INTS_ON enables timing  with  interrupts disabled,
  1936.                       and this mode  is particularly suitable for extremely
  1937.                       short  duration  timing  that   may   be   skewed  by
  1938.                       background interrupt activity.   In  this  mode, only
  1939.                       one timer may be active at any time,  and  each timer
  1940.                       will   "roll   over"   after  54925  microseconds  of
  1941.                       continuous activation.
  1942.  
  1943.                       As long as only one timer is active at once,  the two
  1944.                       timer modes may be freely  mixed.  In order to change
  1945.                       modes, call t_setmode with the desired mode  prior to
  1946.                       calling the t_entry/t_exit functions.
  1947.  
  1948.      Caveat           NO_INTS_ON  mode  is  not  compatible  with  multiple
  1949.                       active timers or BIOS interrupt timing.
  1950.  
  1951.      See Also         None
  1952.  
  1953.  
  1954.      t_start
  1955.  
  1956.  
  1957.      Purpose          Initializes TCHRT timing functions
  1958.  
  1959.      C                int  t_start(void)
  1960.  
  1961.      Synopsis         This function  initializes  the  entire  TCHRT timing
  1962.                       system, and must  be  called prior to any other TCHRT
  1963.                       functions with the  exception  of  t_request.    If a
  1964.                       different  number  of  timers  other than the default
  1965.                       number provided (10) is required, t_request should be
  1966.                       called prior to t_start to specify the number needed.
  1967.                       In C,  if t_start can allocate enough heap to fulfill
  1968.                       the timer  request,  it  will  do  so,  calibrate the
  1969.                       timing  system,  and  return  TRUE.    If  the memory
  1970.                       request  fails,  it  will  return  FALSE.    In Turbo
  1971.                       Pascal, memory allocation failure  will  result  in a
  1972.                       run-time error.  Each timer requires approximately 35
  1973.                       bytes of heap.
  1974.  
  1975.  
  1976.  
  1977.                                     TCHRT  27
  1978.  
  1979.  
  1980.  
  1981.  
  1982.  
  1983.                       The 8253 timer chip is set to mode 2.
  1984.  
  1985.      Caveat           None
  1986.  
  1987.      See Also         t_request, t_stop
  1988.  
  1989.  
  1990.      t_stop
  1991.  
  1992.  
  1993.      Purpose          Shuts down TCHRT timing logic
  1994.  
  1995.      C                void t_stop(void)
  1996.  
  1997.      Synopsis         This  function  deallocates  all heap associated with
  1998.                       generic timers and restores the  8253  timer  chip to
  1999.                       mode 3.  It must be called prior to program exit, and
  2000.                       no TCHRT calls (except t_request) are valid without a
  2001.                       call to t_start to reinitialize the timing system.
  2002.  
  2003.      Caveat           None
  2004.  
  2005.      See Also         t_start, t_request
  2006.  
  2007.  
  2008.      t_suspend
  2009.  
  2010.  
  2011.      Purpose          Suspends an active generic timer
  2012.  
  2013.      C                void t_suspend(int tnum)
  2014.  
  2015.      Synopsis         Functions t_suspend and t_resume  allow  the  user to
  2016.                       stop and restart an active timer without incrementing
  2017.                       its activation count.
  2018.  
  2019.      Caveat           No range checking is done.  NULL pointer reference is
  2020.                       possible if a non-existant timer is specified.
  2021.  
  2022.      See Also         t_resume
  2023.  
  2024.  
  2025.      t_unhook_int
  2026.  
  2027.  
  2028.      Purpose          Removes timers from the specified interrupt vector
  2029.  
  2030.      C                void t_unhook_int(int int_no)
  2031.  
  2032.      Synopsis         This  function  removes  timers  from  the  specified
  2033.                       interrupt  vector  to  disable  precise timing of the
  2034.                       interrupt activity.
  2035.  
  2036.      Caveat           This is a low  level  function and is not meant to be
  2037.                       called by  the user.  Users wishing to understand how
  2038.                       TCHRT interrupt timing is  accomplished  may  want to
  2039.                       inspect the source code to this routine.
  2040.  
  2041.  
  2042.  
  2043.                                     TCHRT  28
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.      See Also         t_hook_int
  2050.  
  2051.  
  2052.  
  2053.  
  2054.  
  2055.  
  2056.  
  2057.  
  2058.  
  2059.  
  2060.  
  2061.  
  2062.  
  2063.  
  2064.  
  2065.  
  2066.  
  2067.  
  2068.  
  2069.  
  2070.  
  2071.  
  2072.  
  2073.  
  2074.  
  2075.  
  2076.  
  2077.  
  2078.  
  2079.  
  2080.  
  2081.  
  2082.  
  2083.  
  2084.  
  2085.  
  2086.  
  2087.  
  2088.  
  2089.  
  2090.  
  2091.  
  2092.  
  2093.  
  2094.  
  2095.  
  2096.  
  2097.  
  2098.  
  2099.  
  2100.  
  2101.  
  2102.  
  2103.  
  2104.  
  2105.  
  2106.  
  2107.  
  2108.  
  2109.                                     TCHRT  29
  2110.  
  2111.  
  2112.  
  2113.  
  2114.                             TCHRT V3.00 Registration
  2115.  
  2116.  
  2117.      Name ______________________________ Company ______________________________
  2118.  
  2119.      Address __________________________________________________________________
  2120.  
  2121.      City/State/Zip ___________________________________________________________
  2122.  
  2123.      Telephone _______________________ Got TCHRT from _________________________
  2124.  
  2125.      Version 3 Single Language Timer Toolboxes.  Includes large & small
  2126.      model libraries (C), full library source, support by US Mail or
  2127.      Compuserve Email.  License does not permit commercial distribution
  2128.      of object code.
  2129.  
  2130.      Qty _____ TCHRT V3 for Turbo C @ $20.00 each ..................... _______
  2131.  
  2132.      Qty _____ MSCHRT V3 for Microsoft C @ $20.00 each ................ _______
  2133.  
  2134.      Qty _____ TPHRT V3 for Turbo Pascal 5 & 5.5 @ $20.00 each ........ _______
  2135.  
  2136.      Version 4 Timer  Toolbox. Supports  TC & MSC in small, medium,
  2137.      compact, and large models, Turbo Pascal 5 & 5.5.  20 additional
  2138.      functions to manage timers, profile interrupts, generate synchronous
  2139.      alarms, run the timer tick interrupt at a user specified rate.
  2140.      Two standalone utilities time execution and profile interrupts of
  2141.      most executable programs without recompilation.  Full library
  2142.      source in C & Pascal included.  Printed manual.  Support by
  2143.      telephone, US Mail or Compuserv Email.  License  permits
  2144.      commercial distribution of object code.
  2145.  
  2146.      Qty ______ PCHRT V4.00 @ $49.95 each ............................. _______
  2147.  
  2148.      Shipping in USA @ $2.00 .......................................... _______
  2149.  
  2150.      Shipping outside USA @ $4.00 ..................................... _______
  2151.  
  2152.      Subtotal ......................................................... _______
  2153.  
  2154.      Michigan residents add 4% ........................................ _______
  2155.  
  2156.      Total enclosed ................................................... _______
  2157.  
  2158.  
  2159.      Payment method:  ___Check  ___Money Order  ___VISA  ___MasterCard
  2160.  
  2161.      Card # ____________________________________________ Exp _________
  2162.  
  2163.      Signature _________________________________________
  2164.  
  2165.      Remit to Ryle Design, P.O. Box 22, Mt. Pleasant, MI 48804
  2166.  
  2167.      Credit  card  customers  may  order  by  Email  on Compuserve  to
  2168.      73047,1765,  or  by telephone at (517) 773-0587.  This is a voice
  2169.      mail system.  Leave your name and number in voice mailbox #2, and
  2170.      your call will be returned and your order taken.
  2171.  
  2172.      Thank you!
  2173.  
  2174.                                    TCHRT  30
  2175.